import request from '@/utils/request'

export function login(data) {
    return request({
        url: '/auth/login',
        method: 'post',
        data
    })
}

export function getInfo(token) {
    return request({
        url: '/user/info',
        method: 'get',
        params: { token }
    })
}

export function logout() {
    return request({
        url: '/user/logout',
        method: 'post'
    })
}


export function getUserList(params) {
    return request({
        url: '/user/index',
        method: 'get',
        params
    })
}
// 添加账户
export function handleAddUser(params) {
    return request({
        url: '/user/save',
        method: 'POST',
        params
    })
}

// 角色列表
export function getRoleIndex(params) {
    return request({
        url: '/role/index',
        method: 'get',
        params
    })
}

// 获取用户基本信息
export function getUserProfile(params) {
    return request({
        url: '/user/profile',
        method: 'get',
        params
    })
}

// 删除用户
export function handleDelete(params) {
    return request({
        url: '/user/del',
        method: 'POST',
        params
    })
}

// 修改账户状态
export function handleSetStatus(params) {
    return request({
        url: '/user/setStatus',
        method: 'POST',
        params
    })
}

// 获取用户基本信息
export function readidcard(params) {
    return request({
        url: '/readcard/readidcard',
        method: 'get',
        params
    })
}
// 获取用户基本信息
export function resetPassword(params) {
    return request({
        url: '/auth/resetPassword',
        method: 'post',
        params
    })
}